import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ken
 * Date: 2023-11-14
 * Time: 17:37
 */

class s
{
    int a;
}
public class Test {
    public static void sort (int[] a) {
        int i = 0;
         while(a[i] % 2 !=0){
            {
              i++;
            }
        }
         int j =a.length-1;
        while(a[j] % 2 == 0){
            {
                j--;
            }
        }
        if(i < j) {
            int temp = a[i];
            a[i] = a[j];
            a[j] = temp;
        }
    }
    public static void main(String[] args) {
        int[] arry = new int[]{1,2,3,4,5};
        sort(arry);
        System.out.println(Arrays.toString(arry));
    }
}
